﻿using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using WebTest.Core.Entities;

namespace WebTest.Infrastructure.Data.Config
{
    public class MemberConfiguration : IEntityTypeConfiguration<Member>
    {
        public void Configure(EntityTypeBuilder<Member> builder)
        {
            builder.Property(b => b.Account)
                .IsRequired()
                .HasMaxLength(50);

            builder.HasIndex(builder => builder.Account)
                .IsUnique();

            builder.Property(b => b.Password)
                .HasMaxLength(50);
        }
    }
}
